<?php
require_once("functions.php");

mysql_select_db($db_baza_date, $baza) or die ('Cannot connect to server! Please retry later!');
set_time_limit (100);
mysql_set_charset('utf8', $baza);

?>
<html>
<head>
<title>Formular autentificare</title>
<link href="style.css" type="text/css" rel="stylesheet">

</head>
<body>
	 <?php if(isset($_SESSION['user']))
		   print '<p> Este logat utilizatorul: '.$_SESSION['user'].'<a href="logout.php">Logout</a>';     
       ?>
	<form action="login.php" method="POST">
	<p align=center><font size=8>Autentificati-va</font></p>
	<br/><br/><br/>
      	<table width="50%" border="0" align="center" cellspacing="5" cellpadding="5">
		<tr class="randCol">
			<td align="center" class="error" colspan="2"><?php if($_GET['error'] == 1) print "Eroare la autentificare. Va rugam reincercati.";?></td>
		</tr>
		<tr>
			<td align="right"><font size=4 color=blue>Username:</font></td>
			<td><input name="user" type="text"  size="30" maxlength="20"></></td>
		</tr>

		<tr>
			<td align="right" width="50%"><font size=4 color=blue>Parola:</font></td>
			<td><input name="pasw" type="password"  size="30" maxlength="20"> </></td>
		</tr>
		<tr>
			<td colspan="2" align="right">     <input type="submit" value="Autentifica-te">   </td>

		</tr>
		<tr>
			<td colspan="2" class="randCol">&nbsp;</td>
		</tr>
		<tr>
			<td align="right"><a href="parola.php"><font color=770000 font size=2>Ati uitat parola?</font></a></td>
			<td align="center"><a href="inregistrare.php"><font color=770000 font size=2>Cont nou?</font></a></td>
                        <td align="left"><a href="schimb.php"><font color=770000 font size=2>Vreau sa schimb parola</font></a></td>
		</tr>	</table>

	<p></p>
	<p></p>

	</form>
</body>
</html>